import request from "@/utils/request";

export function getSuppliers(paramters) {
  return request({
    url: "api/v1/suppliers",
    method: "get",
    params: paramters,
    basicDataServer: true,
  });
}

export function getSupplier(id) {
  return request({
    url: "api/v1/suppliers/"+id,
    method: "get",
    basicDataServer: true,
  });
}

export function addSupplier(data) {
  return request({
    url: "api/v1/suppliers",
    method: "post",
    data: data,
    basicDataServer: true,
  });
}

export function updateSupplier(data) {
  return request({
    url: "api/v1/suppliers",
    method: "put",
    data: data,
    basicDataServer: true,
  });
}

export function deleteSupplier(id) {
  return request({
    url: "api/v1/suppliers/" + id,
    method: "delete",
    basicDataServer: true,
  });
}